package com.ruoyi.system.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.OrderContrastDetail;
import com.ruoyi.system.mapper.OrderContrastDetailMapper;
import com.ruoyi.system.service.IOrderContrastDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 返佣对比信息Service业务层处理
 *
 * @author hjf
 * @date 2025-06-06
 */
@Service
public class OrderContrastDetailServiceImpl implements IOrderContrastDetailService {
    @Autowired
    private OrderContrastDetailMapper orderContrastDetailMapper;

    /**
     * 查询返佣对比信息
     *
     * @param id 返佣对比信息主键
     * @return 返佣对比信息
     */
    @Override
    public OrderContrastDetail selectOrderContrastDetailById(Long id) {
        return orderContrastDetailMapper.selectOrderContrastDetailById(id);
    }

    /**
     * 查询返佣对比信息列表
     *
     * @param orderContrastDetail 返佣对比信息
     * @return 返佣对比信息
     */
    @Override
    public List<OrderContrastDetail> selectOrderContrastDetailList(OrderContrastDetail orderContrastDetail) {
        return orderContrastDetailMapper.selectOrderContrastDetailList(orderContrastDetail);
    }

    /**
     * 新增返佣对比信息
     *
     * @param orderContrastDetail 返佣对比信息
     * @return 结果
     */
    @Override
    public int insertOrderContrastDetail(OrderContrastDetail orderContrastDetail) {
        orderContrastDetail.setCreateTime(DateUtils.getNowDate());
        return orderContrastDetailMapper.insertOrderContrastDetail(orderContrastDetail);
    }

    /**
     * 修改返佣对比信息
     *
     * @param orderContrastDetail 返佣对比信息
     * @return 结果
     */
    @Override
    public int updateOrderContrastDetail(OrderContrastDetail orderContrastDetail) {
        return orderContrastDetailMapper.updateOrderContrastDetail(orderContrastDetail);
    }

    /**
     * 批量删除返佣对比信息
     *
     * @param ids 需要删除的返佣对比信息主键
     * @return 结果
     */
    @Override
    public int deleteOrderContrastDetailByIds(Long[] ids) {
        return orderContrastDetailMapper.deleteOrderContrastDetailByIds(ids);
    }

    /**
     * 删除返佣对比信息信息
     *
     * @param id 返佣对比信息主键
     * @return 结果
     */
    @Override
    public int deleteOrderContrastDetailById(Long id) {
        return orderContrastDetailMapper.deleteOrderContrastDetailById(id);
    }
}
